import { useState } from "react"
import './list.scss'
import Frominput from '../../components/todolist/fronInput'
import ToDoList from '../../components/todolist/list'
const ListFc = () => {
    const [list, setList] = useState({
        list:[
            {
                date:'日期',
                title:'标题',
                priority:'优先级'
            }
        ]
    })
   
    let tolist=(e)=>{
        // console.log(e)
        let newArr=list.list
        newArr.push(e)
        setList(()=>{
            return{
                ...list,
                list:newArr
            }
        })

    }
    return (
        <div className='listbox' >
           <Frominput tolist={tolist}/>
            <ToDoList list={list}/>
        </div>
    )
}
export default ListFc;